<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>合伙人</title>
    <script src="__INDEX__/js/mui.min.js"></script>
	<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
	<link rel="stylesheet" href="__INDEX__/css/style.css" />
	<link rel="stylesheet" href="__INDEX__/css/mall.css" />	
</head>
<body>
	<div class="mui-content hehuor_content">	
		<div><img src="__INDEX__/images/hehuor01.jpg"></div>
		<div><img src="__INDEX__/images/hehuor02.jpg"></div>
		<div><img src="__INDEX__/images/hehuor03.jpg"></div>
		<div><img src="__INDEX__/images/hehuor04.jpg"></div>
	    {if $is_pt==2}
	    <a class="hehuor_btn" id="btn">立即申请</a>
	    {elseif $is_pt==3}
	    <a class="hehuor_btn" >审核中</a>
	    {elseif $is_pt==4}
	    <a class="hehuor_btn" id="btn">您的申请被驳回，请联系管理员</a>
	    {else/}
	    <a class="hehuor_btn" >您已是合伙人</a>
	    {/if}
	</div>
</body>
</html>
<script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/public/static/js/jquery.form.js"></script>
<script type="text/javascript" src="/public/static/layui/layui.all.js"></script>
<script type="text/javascript" src="/public/static/js/assist.js"></script>
<script>	
	//提交请求
	$('#btn').click(function() {
		btn.disabled = true;
		setTimeout(function() {
			btn.disabled = false;
		}, 1500);
		//写入数据库
		layer.confirm('确认申请合伙人吗？', {
			btn: ['确定', '取消'] //按钮
		}, function() {
			$.ajax({
				type:"post",
				//请求的url
				//注意，如果我们使用路由器的情况下，我们需要设置一下本地服务器的ip地址
				url: "{:url('index/member/hehuoren')}",
				//请求的过程中传递过去的参数 json
				//成功了的回调，并且带有返回值
				success: function(data) {
					layer.msg(data.msg, {
					  icon: 1,
					  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						location.href = "{:url('index/member/hehuoren')}";
					}); 
				}
			})
		});
	});
</script>
